package com.xhu.collegestudentrentalsystem.util.constant;

import org.thymeleaf.spring5.processor.SpringUErrorsTagProcessor;

/**
 * @author zhu huilin
 * @date 2023/4/1 14:27
 *  key-value结构中的key值信息
 */
public class KeyMsg {

    /**
     * 返回状态码
     */
    public final static String CODE = "code";

    /**
     * 状态码信息
     */
    public final static String CODE_MSG = "codeMsg";

    /**
     * 返回信息
     */
    public final static String MSG = "msg";

    /**
     * 数据信息
     */
    public final static String DATA = "data";

    /**
     * 令牌信息
     */
    public final static String TOKEN = "token";

    /**
     * 返回错误提示信息
     */
    public final static String ERROR_MSG = "errorMsg";

    /**
     * 用户收藏情况
     */
    public final static String MARK = "mark";

    /**
     * 登录页面随机验证码
     */
    public final static String CAPTCHA = "kaptcha";

    /**
     * png格式图片
     */
    public final static String PNG_PICTURE = "png";

    /**
     * 帖子的点赞数量
     */
    public final static String LIKE_COUNT = "likeCount";

    /**
     * 帖子的点赞状态
     */
    public final static String LIKE_STATUS = "likeStatus";

    /**
     * “最热”高亮显示
     */
    public final static String HOT_IS_LIGHT = "hotIsLight";

    /**
     * 关键词
     */
    public final static String KEY_WORD = "keyword";

    /**
     * 用户相关信息
     */
    public static interface user{
        public String LOGIN_USER_DATA = "loginUserData";
        public String USER_LIST = "users";
        public String LOGIN_USER_MSG = "loginUserMsg";
        public String LOGIN_PASS_MSG = "loginPassMsg";
        public String USER = "user";
    }

    /**
     * 返回房屋相关的实体对象
     */
    public static interface house{
        // 返回实体对象
        public String HOUSE_ENTITY = "house";
        // 返回实体对象列表
        public String HOUSE_LIST = "houses";
        // 新增房子结果信息
        public String ADD_HOUSE_RESULT = "addHouseResult";
        // 接收房屋属性dto
        public String HOUSE_DTO = "houseDTO";
        // 收藏房子信息
        public String HOUSE_MARK = "housesMark";
        // 新发布房子信息
        public String HOUSE_LIST_NEWS = "housesNew";
        // 高分房子
        public String HOUSE_LIST_HIGH_SCORE = "housesHighScore";
    }

    /**
     * 新闻相关key信息
     */
    public static interface news{
        public String NEWS = "news";
        public String NEWS_LIST = "newsList";
    }

    /**
     * 反馈信息列表
     */
    public final static String FEEDBACK_LIST = "feedbackList";

    /**
     * 地址信息
     */
    public static interface address{
        public String ADDRESS = "address";
        public String LONGITUDE = "longitude";
        public String LATITUDE = "latitude";
    }

    /**
     * 订单信息
     */
    public static interface order{
        public String ORDER_ID = "orderId";
        public String ORDER = "order";
        public String ORDER_LIST = "orders";
    }

    /**
     * 帖子信息
     */
    public static interface discussPost{
        public String DISCUSS_POST = "discussPost";
        public String DISCUSS_POST_LIST = "discussPosts";
        public String DISCUSS_POST_TYPE = "postType";
        public String DISCUSS_POST_STATUS = "postStatus";
    }

    /**
     * Redis存储key信息的前缀
     */
    public static interface redis{
        // 点赞
        public String PREFIX_LIKE = "like";
        // key分隔符
        public String SPLIT = ":";
    }

    /**
     * 获取帖子或评论的key信息
     */
    public static String getEntityLikeKey(Integer entityType, Long entityId){
        return redis.PREFIX_LIKE + redis.SPLIT + entityType + redis.SPLIT + entityId;
    }
}
